{block name="circle_layout"}
	{include file="common:common_layout"}
{/block}
{extend name="common/layout" /}
{block name="style"}<link href="__CIRCLE_TEMPLATES_URL__/css/ubb.css" rel="stylesheet" type="text/css">{/block}
{block name="content"}
<?php if($circle_info['circle_status'] == 1){?>
<div class="group warp-all">
    {include file="circle:group:group_top" /}
    <div class="group-post">
        <h3>发布新话题...</h3>
        <div class="stat"><span class="noborder">今日<em><?php echo $todaythcount;?></em></span><span>话题：<em><?php echo $circle_info['circle_thcount'];?></em></span><span>圈友：<em><?php echo $circle_info['circle_mcount'];?></em></span></div>
        <div class="clear">&nbsp;</div>
        <div class="thread-layer">
            <div class="input-style">
                <?php
        if(!intval(sysconf('circle_istalk'))){
          echo '网站已经关闭发表话题功能。';
        }else if(session('is_login') != 1){
          echo '您目前还没有登录，请先<a href="javascript:void(0);" nctype="login">登录：</a>';
                }else if(in_array($identity, array(0,5))){
                echo '请您先<a href="javascript:void(0);" nctype="apply">加入本圈</a>后再发帖';
                }else if($identity == 4){
                echo '等待申请审核通过后才能发表话题';
                }else if($identity == 6){
                echo '被禁言，不能在发布话题。';
                }else{
                echo "<p>&nbsp;</p>";
                }
                ?>
            </div>
            <div class="button-style-tp"><a href="<?php echo url('circle/Theme/new_theme', array('sp' => 1, 'c_id' => $c_id));?>">发投票</a></div>
            <div class="button-style">发布新话题</div>

        </div>
        <!-- 编辑器 S -->
        {include file="circle:group:editor" /}

        <!-- 编辑器 E -->
        <div class="clear"></div>
    </div>
    <div class="base-layout mt20">
        <div class="mainbox">
            <div class="base-tab-menu">
                <ul class="base-tabs-nav">
                    <li class="selected"><a href="{:url('circle/Group/index',array('c_id'=>$c_id))}">话题</a></li>
                    <li><a href="{:url('circle/Group/group_member',array('c_id'=>$c_id))}">圈友</a></li>
                    <!--<li><a href="{:url('circle/group/group_goods',array('c_id'=>$c_id))}">商品</a></li>-->
                </ul>
            </div>
            <div class="group-list-bar">
                <div class="group-theme-class"> 
                	<a href="{:url('circle/Group/index',array('c_id'=>$c_id))}" <?php if($thc_id == ''){?>class="selected"<?php }?>><i></i>全部</a>
                    <?php if(!empty($thclass_list)){?>
                    <?php foreach ($thclass_list as $val){?>
                    <a href="{:url('circle/Group/index',array('thc_id'=>$val['thclass_id'],'c_id'=>$c_id))}" {if condition="$thc_id eq $val['thclass_id']"}class="selected"{/if}><?php echo $val['thclass_name'];?></a>
                    <?php }?>
                    <?php }?>
                </div>
                <div class="group-theme-read-control">
                    <div class="read-model">
                        <a href="{:url('circle/Group/index',array('cream'=>1,'c_id'=>$c_id))}" title="精品话题"><i class="digest"></i></a>
                        <a href="{:url('circle/Group/index',array('c_id'=>$c_id,'type'=>'preview'))}" <?php if($display_mode == 'preview'){?>class="selected"<?php }?>><i class="preview"></i>图文</a>
                        <a href="{:url('circle/Group/index',array('c_id'=>$c_id,'type'=>'list'))}" <?php if($display_mode == 'list'){?>class="selected"<?php }?>><i class="list"></i>列表</a>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
            <div class="<?php if($display_mode == 'preview'){?>read-model-preview<?php }else{?>read-model-list<?php }?>">
                <div class="group-theme-top"><span class="theme">话题</span><span class="writer">作者</span><span class="stat">回复查看</span><span class="lastspeak">最后发言</span></div>
                <?php if(!empty($theme_list)){?>
                <ul class="group-theme-list">
                    <?php foreach(($theme_list) as $val){?>
                    <li nctype="li<?php echo $val['theme_id'];?>">
                        <div class="theme-icon"><i class="<?php if($val['is_stick'] == 1){
            	echo 'top';
            }elseif($val['is_digest'] == 1){
            	echo 'digest';
            }elseif($val['is_shut'] == 1){
            	echo 'close';
            }elseif($val['theme_special']==1){
				echo 'poll';
            }else{
            	echo 'normal';
            }?>" title=""></i></div>
                        <div class="theme-title">
                            <a href="javascript:void(0);" class="theme-class">【<?php if($val['thclass_name'] != ''){echo $val['thclass_name'];}else{echo '默认';}?>】</a>
                            <?php if($m_readperm >= $val['theme_readperm']){?>
                            <a href="{:url('circle/theme/theme_detail',array('c_id'=>$c_id,'t_id'=>$val['theme_id']))}" class="theme-name"><?php echo $val['theme_name'];if($val['theme_readperm'] > 0){ echo '<font>【阅读权限lv'.$val['theme_readperm'].'】</font>';}?></a>
                            <?php }else{?>
                            <a href="javascript:void(0);" class="theme-name" onclick="showError('权限不足，不能访问或执行操作');"><?php echo $val['theme_name'];if($val['theme_readperm'] > 0){ echo '<font>【阅读权限lv'.$val['theme_readperm'].'】</font>';}?></a>
                            <?php }?>
                            <?php if($val['is_closed'] == '0' && $m_readperm >= $val['theme_readperm']){?>
                            <a href="javascript:void(0);" class="read-unfold" nctype="theme_read" data-param="<?php echo $val['theme_id'];?>"><i></i>展开主题</a>
                            <?php }?>
                        </div>
                        <?php if($val['is_closed'] == '0'){?>
                        <div class="theme-intro">
                            <p class="theme-intro-txt"><?php echo replaceUBBTag($val['theme_content']);?></p>
                            <?php if($m_readperm >= $val['theme_readperm']){?>
                            <?php if(isset($affix_list[$val['theme_id']])){?>
                            <div class="theme-intro-pic">
                                <?php $array = array_slice($affix_list[$val['theme_id']], 0, 3);foreach($array as $v){ ?>
                                <div class="thumb"><a href="javascript:void(0);" class="read-unfold"><img src="<?php echo themeImageUrl($v['affix_filethumb']);?>" class="t-img"/> </a> <span nctype="theme_read">点击图片展开</span></div>
                                <?php }?>
                            </div>
                            <?php }?>
                            <?php }?>
                        </div>
                        <div class="theme-detail-content" style="display:none;"></div>
                        <div class="quick-reply-box" style="display:none;"><i></i>
                            <div class="quick-reply-2"></div>
                        </div>
                        <?php }else{?>
                        <div class="theme-intro">被禁言用户</div>
                        <?php }?>
                        <div class="theme-writer"><i title="作者"></i><a href="javascript:void(0)"  title="<?php echo $val['member_name'];?>"><?php echo $val['member_name'];?></a><?php echo memberIdentity($val['is_identity']);?></div>
                        <div class="theme-writer-time" title="发表时间"><?php echo @date('Y-m-d', $val['lastspeak_time']);?></div>
                        <div class="theme-stat" title="已有{$val['theme_browsecount']}人次浏览{$val['theme_commentcount']}人次回复本主题"><em><?php echo $val['theme_commentcount'];?></em>/<em><?php echo $val['theme_browsecount'];?></em></div>
                        <?php if($val['lastspeak_name'] != ''){?>
                        <div class="theme-lastspeak-name"><i title="最后回复人"></i><a href="javascript:void(0)" title="<?php echo $val['lastspeak_name'];?>"><?php echo $val['lastspeak_name'];?></a></div>
                        <div class="theme-lastspeak-time" title="最后回复时间"><?php echo @date('Y-m-d', $val['lastspeak_time']);?></div>
                        <?php }else{?>
                        <div class="theme-noreply">-&nbsp;暂无回复&nbsp;-</div>
                        <?php }?>
                    </li>
                    <?php }?>
                </ul>
                <div class="pagination"><?php echo $show_page;?></div>
                <?php }else{?>
                <div class="no-theme"><span><i></i><?php if(I('get.cream') == 1){echo '很遗憾，本圈尚无精华话题。';}else{echo '很遗憾，尚无圈友发表的话题。';}?></span></div>
                <?php }?>
            </div>
        </div>
        {include file="circle:group:group_sidebar" /}
        
        <div class="clear"></div>
    </div>
</div>
<script type="text/javascript" src="__SITE_RESOURCE__/js/jquery.charCount.js"></script>
<script type="text/javascript" src="__SITE_RESOURCE__/js/jquery.validation.min.js"></script>
<link href="__SITE_RESOURCE__/js/jquery.nyroModal/styles/nyroModal.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__SITE_RESOURCE__/js/jquery.nyroModal/custom.min.js"></script>
<?php }else if($circle_info['circle_status'] == 2){?>
<div class="warp-all">
    <div class="circle-status"><i class="icon02"></i><h3>圈子正在审批中，请稍后再试。。。</h3></div>
</div>
<?php }else if($circle_info['circle_status'] == 3){?>
<div class="warp-all">
    <div class="circle-status"><i class="icon03"></i><h3>很遗憾，该圈子审批失败：（</h3><?php if($circle_info['circle_statusinfo'] != ''){echo '<h5>原因：'.$circle_info['circle_statusinfo'].'</h5>'; }?></div>
</div>
<?php }else{?>
<div class="warp-all">
    <div class="circle-status"><i class="icon01"></i><h3>对不起，该圈子已被关闭！</h3><?php if($circle_info['circle_statusinfo'] != ''){echo '<h5>原因：'.$circle_info['circle_statusinfo'].'</h5>'; }?></div>
</div>
<?php }?>
{/block}